home *** CD-ROM | disk | FTP | other *** search
- Path: news-m01.ny.us.ibm.net!usenet
- From: trosky@ibm.net
- Newsgroups: comp.lang.rexx
- Subject: Re: VisPro/Rexx and Object Rexx
- Date: 3 Apr 1996 17:19:20 GMT
- Distribution: inet
- Message-ID: <4jubuo$3hoq@news-s01.ny.us.ibm.net>
- References: <4jjuo8$f6a@server-b.cs.interbusiness.it> <4jpgp1$ou4@ralph.vnet.net> <4jqfsg$hen@server-b.cs.interbusiness.it> <4jsagj$ahb@news1.mnsinc.com>
- Reply-To: trosky@ibm.net
- NNTP-Posting-Host: slip166-72-228-74.pa.us.ibm.net
- X-Newsreader: IBM NewsReader/2 v1.2.5
-
- In <4jsagj$ahb@news1.mnsinc.com>, johnshoy@os2bbs.com writes:
- >I want to use the new Object Rexx for OS/2 with VisPro REXX. In object rexx,
- >the directives and methods for your new classes are supposed to be the last
- >source code in your program. In VisPro REXX, where would I put the class directives
- >and methods in order for them to be the last source code? In the "when closed"
- >form for the main form in the project? Or, is VisPro REXX always gong to
- >have the last word by inserting code to clean up after itself after executing the
- >last user written code?
- >
- >Mike Johnshoy
- >johnshoy@os2bbs.com
-
- Mike,
-
- There are two ways to make VisPro REXX work with Object REXX:
-
- 1. Create a program, like "MakeMeths.CMD" which
- makes all your public classes and methods.
-
- Then in your VisPro "When Opened" event for the
- main form, simply include a statement
-
- call MakeMeths.CMD
-
- 2. Use our technique of creating classes and objects and
- putting them in the global .environment.
-
- For instance, when you create a new class, make a program
- like this and run it at startup.
-
- /* makestuff.CMD - make classes and store them in .environment */
-
- ::class myClass
-
- ::method INIT class
- .environment['MYCLASS'] = self /* puts myClass in .environment*/
- myObjDir = .directory~NEW
- .environment['MYOBJDIR'] = myObjDir /* makes global directory
- for my objects */
-
-
-
- ::method INIT
- use arg obj_id /* some id/key for your objects */
- .myObjDir[obj_id] = self /* puts object in global directory */
-
-
-
- ::method myClassMeth class
- ...
-
-
-
- ::method myInstMeth
- ...
-
-
-
- In your VisPro REXX programs, you can simply use
-
-
-
- .myClass~myClassMeth
-
-
-
- .myObjDir[obj_id]~myInstMeth
-
- You don't have to do anything in VisPro to use these
- They are in the environment.
-
- We have examples of these in our book.
-
- Hope this helps,
- Will Trosky
-